/**********************************************************************
 * SailmiPIM - modular cross-platform feature Personal Information Manager Tools.
 * Copyright(C) 2010-2012  Oleg Linkin
 * Copyright(C) 2006-2014  Georg Rudoy
 *
 * Distributed under the Boost Software License, Version 1.0.
 *(See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
 **********************************************************************/

#include "userplugin.h"
#include <QIcon>
#include <QMenu>
#include <QtDebug>
#include <util/core/util.h>
#include <sailmipim/core/icoreproxy.h>
#include <sailmipim/core/iiconthememanager.h>
#include <sailmipim/core/icoretabwidget.h>
#include <sailmipim/core/irootwindowsmanager.h>
#include "userproxyimp.h"
namespace SailmiPIM::Plugin::UserProxy
{
	void Plugin::Init(ICoreProxy_ptr proxy)
	{
        qDebug() << "UserPugin::Init::Start Init UserPlugin";
        Util::InstallTranslator("userproxy");
        UserProxyImp *userProxy=new UserProxyImp();
        proxy->GetUserManager()->setUserProxy(userProxy);
		Proxy_ = proxy;

	}

	void Plugin::SecondInit()
	{
	}

	QByteArray Plugin::GetUniqueID() const
	{
        return "com.sailmi.pim.plugin.UserProxy";
	}

	void Plugin::Release()
	{
	}

	QString Plugin::GetName() const
	{
        return "UserProxy";
	}

	QString Plugin::GetInfo() const
	{
		return tr("Support tabs pinning.");
	}

	QIcon Plugin::GetIcon() const
	{
		return Proxy_->GetIconThemeManager()->GetPluginIcon();
	}

	QSet<QByteArray> Plugin::GetPluginClasses() const
	{
        return { "com.sailmi.pim.Core.Plugins/1.0" };
	}

    bool Plugin::IsCore() const
    {
        return true;
    }

}

    SAILMIPIM_EXPORT_PLUGIN(sailmipim_userproxy, SailmiPIM::Plugin::UserProxy::Plugin);
